using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Telerik.WinControls;
using BO;
using BL;
namespace AnimalFarm.Vet_manage
{
    public partial class AddVet : Telerik.WinControls.UI.RadForm
    {
        B_Vet vetManager;
        public AddVet()
        {
            InitializeComponent();
            vetManager = B_Vet.CreateInstance();
        }

        private void radButton1_Click(object sender, EventArgs e)
        {
            Vet_Info vet = new Vet_Info();
            vet.MAFFLicenceID = cm_maffID.SelectedText;
            vet.UserName = txt_username.Text;
            vet.Password = txt_pass.Text;
            vet.PhoneNumber = txt_phone.Text;
            vet.Address = txt_address.Text;
            vet.DOB = dtpTime.Value;
            vet.VetName = txtName.Text;
            
          bool ok=  vetManager.CreateOneVet(vet);
          if (ok)
              MessageBox.Show("Add successfully");
          else
              MessageBox.Show("Add fail");
        }

        private void groupBox2_Enter(object sender, EventArgs e)
        {

        }

        private void cm_livestockType_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
        {

        }
    }
}
